﻿using System;
using System.Collections;
using System.Collections.Generic;
namespace CJ.XNFZ.SCORE {
    public class ScoreSystemHelper : Singleton<ScoreSystemHelper> {
        public enum UserType {
            student,
            specialist,
            ilabx
        }
        public UserType userType = UserType.specialist;

        public string projectTitle = "在园幼儿气道异物阻塞急救处理虚拟仿真实验教学项目";

        public void Checkin () {
            dontDestroy = true;
            print(DontDestroy);
            switch (userType) {
                case UserType.ilabx:
                    ILABX.ILABXHelper.Instance.Status ();
                    return;
            }
        }

        public void UploadScore (string scoretitle, string scoreid, string scorevertion, int score, long starttime, long endtime, int usedtime, List<string> keys = null, List<string> scores = null, List<string> startTime = null, List<string> endTime = null, List<string> repeatCount = null, Action ok = null, Action<string> error = null) {
            switch (userType) {
                case UserType.specialist:
                    return;
                case UserType.student:
                    //chujiaoUploadScore (scoreid, scorevertion, keys, scores, startTime, endTime, repeatCount, ok, error);
                    return;
                case UserType.ilabx:
                    //ilabxUploadScore (scoretitle, score, starttime, endtime, usedtime, ok, error);
                    return;
            }
        }

        protected void ilabxUploadScore (string scoretitle, int score, long startDate, long endDate, int timeUsed, Action ok = null, Action<string> error = null) {
            ILABX.ILABXHelper.Instance.Log (projectTitle, scoretitle, 1, score, startDate, endDate, timeUsed, ok, error);
        }

        protected void chujiaoUploadScore (string packageid, string scorevertion, List<string> keys = null, List<string> scores = null, List<string> startTime = null, List<string> endTime = null, List<string> repeatCount = null, Action ok = null, Action<string> error = null) {
            Server.XNFZServerHelper.Instance.Log (packageid, scorevertion, keys, scores, startTime, endTime, repeatCount, TimeHelper.Instance.GetNow (), ok, error);
        }

    }
}